package com.example.administrator.about_huanxin;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Administrator on 2017/3/9.
 */
public final class ShareprefenceUtils {

    public static final String PREF_NAME = "config";

    public static String getResult(Context ctx, String key,
                                     String defaultValue) {
        SharedPreferences sp = ctx.getSharedPreferences(PREF_NAME,
                Context.MODE_PRIVATE);
        return sp.getString(key, defaultValue);
    }

    public static void setResult(Context ctx, String key, String value) {
        SharedPreferences sp = ctx.getSharedPreferences(PREF_NAME,
                Context.MODE_PRIVATE);
        sp.edit().putString(key, value).commit();
    }
}
